<?php

/* @var $this yii\web\View */

use yii\bootstrap\Carousel;

?>
<div class="site-index">
    <?php
    $carousel_array = [];
    foreach ($carousel as $key => $value){
        $carousel_array[$key] = ['content' => '<a href="'.$value['car_link'].'"><img src="'.$value['car_pic_url'].'" style="width:100%;"></a>'];
    }
      echo Carousel::widget([
          'items' => $carousel_array,
          'options' => [
              'class' => 'slide'
          ]
      ]);
    ?>
    
    <div class="page-header text-center">
        <h3>欢迎来到<?= Yii::$app->params['app_name']?></h3>
    </div>

    <div class="body-content container-fluid" style="margin-bottom: 50px; ">
        <div style="margin: 0 auto; width: 1224px;">            
            <?php foreach ($panel as $value):?>
            <a class="panel-ex" href="<?= $value['pan_link']?>">
                <div style="width: 306px; height: 210px; float: left; padding: 0 10px; position: relative">
                    <img src="<?= $value['pan_pic_url']?>" style="width: 100%; height: 100%; background-color: #bbb;">
                    <div class="title-ex" style="width: 95% ; height: 30px ; background-color: rgba(0,0,0,0.7); position: absolute; bottom: 0; padding: 0 10px;">
                        <h5 style="color: white"><?= $value['pan_title']?></h5>
                    </div>
                    <div class="explain-ex" style="width: 95% ; height: 100% ; background-color: rgba(0,0,0,0.7); position: absolute; bottom: 0; padding: 30px; display: none; text-indent: 2em ">
                        <h4 style="color: white"><?= $value['pan_explain']?></h4>
                    </div>
                </div>
            </a>
            <?php endforeach;?>
        </div>
    </div>
</div>
